import React, { Component } from 'react'
import { Link } from 'react-router-dom'
import {localClass} from './style.scss'

class Crumbs extends Component {

  render() {
    const {
      list,
    } = this.props;
    return (
      <div className={localClass}>
        <div className="mid">
          <span>当前位置：</span>
          { list.length > 0 && list.map((item, index) => (
            item.name && <i key={index}>
              { item.path? <Link to={item.path}>{item.name}</Link> : <a>{item.name}</a> }
              { index !== list.length - 1 && <em>></em>}
            </i>
          ) ) }
        </div>
      </div>
    )
  }
}

export default Crumbs;
